package com.ruoyi.consume.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.consume.mapper.GraftinglabelApplyTemporaryConMapper;
import com.ruoyi.consume.domain.GraftinglabelApplyTemporaryCon;
import com.ruoyi.consume.service.IGraftinglabelApplyTemporaryConService;

/**
 * 嫁接签临时领用Service业务层处理
 *
 * @author ruoyi
 * @date 2021-07-27
 */
@Service
public class GraftinglabelApplyTemporaryConServiceImpl implements IGraftinglabelApplyTemporaryConService
{
    @Autowired
    private GraftinglabelApplyTemporaryConMapper graftinglabelApplyTemporaryConMapper;

    /**
     * 查询嫁接签临时领用
     *
     * @param graftinglabelApplyTemporaryId 嫁接签临时领用ID
     * @return 嫁接签临时领用
     */
    @Override
    public GraftinglabelApplyTemporaryCon selectGraftinglabelApplyTemporaryById(Long graftinglabelApplyTemporaryId)
    {
        return graftinglabelApplyTemporaryConMapper.selectGraftinglabelApplyTemporaryById(graftinglabelApplyTemporaryId);
    }

    /**
     * 查询嫁接签临时领用列表
     *
     * @param graftinglabelApplyTemporaryCon 嫁接签临时领用
     * @return 嫁接签临时领用
     */
    @Override
    public List<GraftinglabelApplyTemporaryCon> selectGraftinglabelApplyTemporaryList(GraftinglabelApplyTemporaryCon graftinglabelApplyTemporaryCon)
    {
        return graftinglabelApplyTemporaryConMapper.selectGraftinglabelApplyTemporaryList(graftinglabelApplyTemporaryCon);
    }

    /**
     * 新增嫁接签临时领用
     *
     * @param graftinglabelApplyTemporaryCon 嫁接签临时领用
     * @return 结果
     */
    @Override
    public int insertGraftinglabelApplyTemporary(GraftinglabelApplyTemporaryCon graftinglabelApplyTemporaryCon)
    {
        graftinglabelApplyTemporaryCon.setCreateTime(DateUtils.getNowDate());
        return graftinglabelApplyTemporaryConMapper.insertGraftinglabelApplyTemporary(graftinglabelApplyTemporaryCon);
    }

    /**
     * 修改嫁接签临时领用
     *
     * @param graftinglabelApplyTemporaryCon 嫁接签临时领用
     * @return 结果
     */
    @Override
    public int updateGraftinglabelApplyTemporary(GraftinglabelApplyTemporaryCon graftinglabelApplyTemporaryCon)
    {
        graftinglabelApplyTemporaryCon.setUpdateTime(DateUtils.getNowDate());
        return graftinglabelApplyTemporaryConMapper.updateGraftinglabelApplyTemporary(graftinglabelApplyTemporaryCon);
    }

    /**
     * 批量删除嫁接签临时领用
     *
     * @param graftinglabelApplyTemporaryIds 需要删除的嫁接签临时领用ID
     * @return 结果
     */
    @Override
    public int deleteGraftinglabelApplyTemporaryByIds(Long[] graftinglabelApplyTemporaryIds)
    {
        return graftinglabelApplyTemporaryConMapper.deleteGraftinglabelApplyTemporaryByIds(graftinglabelApplyTemporaryIds);
    }

    /**
     * 删除嫁接签临时领用信息
     *
     * @param graftinglabelApplyTemporaryId 嫁接签临时领用ID
     * @return 结果
     */
    @Override
    public int deleteGraftinglabelApplyTemporaryById(Long graftinglabelApplyTemporaryId)
    {
        return graftinglabelApplyTemporaryConMapper.deleteGraftinglabelApplyTemporaryById(graftinglabelApplyTemporaryId);
    }

    /**
     * 更新库存量表
     *
     * @param graftinglabelApplyTemporaryCon 嫁接签临时领用
     * @return 结果
     */
    @Override
    public int updateAmount(GraftinglabelApplyTemporaryCon graftinglabelApplyTemporaryCon){
        return graftinglabelApplyTemporaryConMapper.updateAmount(graftinglabelApplyTemporaryCon);
    }

    /**
     * 更新领用状态
     *
     * @param graftinglabelApplyTemporaryId 嫁接签临时领用ID
     * @return 结果
     */
    @Override
    public int updateConsumeStatus(Long graftinglabelApplyTemporaryId){
        return graftinglabelApplyTemporaryConMapper.updateConsumeStatus(graftinglabelApplyTemporaryId);
    }

    /**
     * 退回操作
     *
     * @param graftinglabelApplyTemporaryId 嫁接签临时领用ID
     * @return 结果
     */
    @Override
    public int updateApprovalStatus(Long graftinglabelApplyTemporaryId){
        return graftinglabelApplyTemporaryConMapper.updateApprovalStatus(graftinglabelApplyTemporaryId);
    }
}
